package ru.uskov.trainer.datastore;

import java.util.logging.Logger;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {
  private static final PersistenceManagerFactory pmfInstance;
  private static final Logger log = Logger.getLogger(PMF.class.getName());

  static {
    long start = System.currentTimeMillis();
    pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");
    log.info("Initialisation of PMF took " + (System.currentTimeMillis() - start) + " ms.");
  }

  private PMF() {
  }

  public static PersistenceManagerFactory get() {
    return pmfInstance;
  }

}